<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h2>透传Attribute</h2>
      <!-- 了解 -->
      <!-- 当子组件的根元素只有一个的时候，给组件添加的class和id就会直接挂载到子组件的根元素上面 -->
      <child class="wrap" id="container"></child>
    </div>

    <script src="./lib/vue3.js"></script>
    <script>
      const { createApp } = Vue;

      const Child = {
        template: `
          <div>
            <div class="red">child组件</div>
            <div>123</div>
          </div>
        `,
      };

      createApp({
        data() {
          return {};
        },
        components: {
          Child,
        },
      }).mount("#app");
    </script>
  </body>
</html>
